﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class pro_mis_level_editlevel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MasApp.BLL.Check.CheckLogin();
            if (Request.QueryString["levelmissionid"] != null)
            {
                int levelmissionid = Convert.ToInt32(Request.QueryString["levelmissionid"].ToString());
                MasApp.Model.applevel ap = new MasApp.Model.applevel();
                ap.Levelmissionid = levelmissionid;
                string state="";
                for (int i = 0; i < GridView1.Rows.Count; i++)
                {
                    int ruleid = Convert.ToInt32(((Label)GridView1.Rows[i].FindControl("Label1")).Text);
                    DataTable dt_indi = MasApp.BLL.Search.SearchIndicatorIDsandNames(ruleid);
                    for (int j = 0; j < dt_indi.Rows.Count; j++)
                    {
                        ap.Indicatorid = Convert.ToInt32(dt_indi.Rows[j]["indicatorid"].ToString());
                        if (MasApp.BLL.Search.ExistsApplevel(ap))
                        { state = "已评的"; break; }
                        else
                        {
                            state = "未评的";
                        }
                    }
                    ((Label)GridView1.Rows[i].FindControl("lb_state")).Text = state;
                }
            }
        }
    }
}
